//  Inside Microsoft Exchange 2007 Web Services 
//  Chapter 13
//
//  Copyright (c) 2007 David Sterling, Ben Spain, Mark Taylor, Huw Upshall, Michael Mainer.  
//  All rights reserved.
//
using System;
using System.Collections.Generic;
using System.Text;
using ProxyHelpers.EWS;

namespace ExtendedPropertiesInResponseShape
{
    class Program
    {
        static void Main(string[] args)
        {
            ItemResponseShapeType responseShape = CreateResponseShapeWithExtendedProperties();
        }

        /// <summary>
        /// Create an ItemResponseShape with extended properties (Listing 13-12)
        /// </summary>
        /// <returns>ItemResponseShape</returns>
        /// 
        public static ItemResponseShapeType CreateResponseShapeWithExtendedProperties()
        {
            PathToExtendedFieldType extendedPropPath1 =
               PathToExtendedFieldType.BuildGuidId(
                     new Guid("24040483-cda4-4521-bb5f-a83fac4d19a4"),
                     2,
                     MapiPropertyTypeType.StringArray);

            PathToExtendedFieldType extendedPropPath2 =
                           PathToExtendedFieldType.BuildGuidName(
                                 DistinguishedPropertySetType.PublicStrings,
                                 "ShoeSize",
                                 MapiPropertyTypeType.Float);

            // Use our ItemResponseShapeType overloaded constructor
            //
            ItemResponseShapeType responseShape = new ItemResponseShapeType(
                                                    DefaultShapeNamesType.IdOnly,
                                                    extendedPropPath1,
                                                    extendedPropPath2);
            return responseShape;
        }
    }
}
